precision mediump float;
const float near = 10.0;
const float far = 50.0;
void main() {

     // 转换成线性
     float z = gl_FragCoord.z;
     float srcZ = (near * far)/(z * near + far * (1.0 - z));
     float linearDepth = (srcZ - near) / (far - near);
     gl_FragColor = vec4(vec3(linearDepth,1.0,0.0),1.0);
//     gl_FragColor = vec4(vec3(linearDepth),1.0);
//     float z = gl_FragCoord.z;
//     gl_FragColor = vec4(z ,0.0,0.0,0.0);
}
